<template>
  <view class="card list-item" @click="handleItem(item)">
    <view class="top">
      <view>
        <text class="title">{{item.name}}</text>
        <text v-if="item.sex == '男'" class="person-icon man"></text>
        <text v-else-if="item.sex == '女'" class="person-icon woman"></text>
      </view>
      <text class="salary title">{{item.salaryExpectation}}</text>
    </view>
    <view class="tag-cont">
      <text class="tag-item" v-show="item.workingYears">{{item.workingYears}}年工作经验</text>
      <text class="tag-item" v-show="item.highestEducation">{{item.highestEducation}}</text>
      <text class="tag-item" v-show="item.arrivalTime">{{item.arrivalTime}}</text>
    </view>
    <view class="job u-border-bottom">
      <text class="sub-title">应聘职位：</text>
      {{item.intendedPosition}}
    </view>
    <text class="sub-title time">填写时间：{{item.createTime}}</text>
  </view>
</template>

<script>
export default {
  props: {
    item: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  methods: {
    handleItem(item) {
      uni.navigateTo({
        url: `/pagesSub/userCenter/hrDetail/index?resumeId=${item.resumeId}`
      });
    }
  }
};
</script>

<style lang="scss" scoped>
$img-base-person: $img-base + "pcenter/";
.card {
  margin-bottom: 24rpx;
  padding: 32rpx;
  background: $uni-bg-color;
  border-radius: 20rpx;
  box-shadow: 0 17rpx 15rpx 5rpx #f3f3f3;
  .top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .title {
      font-size: 32rpx;
    }
  }
  .job {
    padding-bottom: 24rpx;
    margin-bottom: 24rpx;
  }
  .sub-title {
    color: #b2b2b2;
    &.time {
      margin: 0;
      padding-top: 24rpx;
    }
  }
  .salary {
    font-weight: 500;
    color: #ff5637;
  }
  .tag-cont {
    margin: 32rpx 0;
  }
  .tag-item {
    background-color: #f5f5f5;
    color: #888;
    padding: 8rpx 12rpx;
    margin-right: 8rpx;
    border-radius: 6rpx;
  }
}
.person-icon {
  display: inline-block;
  width: 24rpx;
  height: 24rpx;
  margin-left: 12rpx;
  &.woman {
    background: url($img-base-person+"woman.png") no-repeat center / 100% 100%;
  }
  &.man {
    background: url($img-base-person+"man.png") no-repeat center / 100% 100%;
  }
}
</style>